DEFINE MISSIONS 1
DEFINE MISSION 0 AT @MISSN_08
DEFINE EXTERNAL_SCRIPTS 0

DEFINE UNKNOWN_EMPTY_SEGMENT 0

DEFINE UNKNOWN_THREADS_MEMORY 500

{$VERSION 3.1.0027}
var
 $PLAYER_CHAR: Player
end // var 
//Main thread starts here                     
03A4: name_thread 'MAIN' 
//Set the screen BLACK immediately
016A: fade 0 time 0            

01F0: set_max_wanted_level_to 6 
0111: toggle_wasted_busted_check 0 
00C0: set_current_time_hours_to 8 minutes_to 0 
0629: change_integer_stat 181 to 4              //All Cities Open
062A: change_float_stat 165 to 800.0            //Energy
062A: change_float_stat 23 to 150.0             //Muscle
062A: change_float_stat 21 to 200.0             //Fat
062A: change_float_stat 160 to 150.0            //Driving Skill
0629: change_integer_stat 68 to 10              //Respect
//Loads Tenpenny as #SPECIAL01 or 290
023C: load_special_actor 'TENPEN' as 1 

//Create Player at Station
03CB: set_rendering_origin_at 1550.68 -1675.49 14.51
$PLAYER_CHAR = Player.Create(#NULL, 1550.68, -1675.49, 14.51)
 
Player.SetClothes($PLAYER_CHAR, "VEST", "VEST", Torso)
Player.SetClothes($PLAYER_CHAR, "JEANSDENIM", "JEANS", Legs)
Player.SetClothes($PLAYER_CHAR, "SNEAKERBINCBLK", "SNEAKER", Shoes)
Player.SetClothes($PLAYER_CHAR, "PLAYER_FACE", "HEAD", Head)  
Player.Build($PLAYER_CHAR)

//Changes the player to ped model 290 Tenpenny
09C7: change_player $PLAYER_CHAR model_to 290 
01F5: $PLAYER_ACTOR = create_player_actor $PLAYER_CHAR 
07AF: $PLAYER_GROUP = player $PLAYER_CHAR group 
Actor.Angle($PLAYER_ACTOR) = 90.0
01B6: set_weather 1 
0001: wait 0 ms 
01B4: toggle_player $PLAYER_CHAR can_move false //We shut down control for the cameras to work 
04BB: select_interior 0 
016C: restart_if_wasted_at 1550.68 -1675.49 14.51 angle 90.0 town_number 0 
016D: restart_if_busted_at 1550.68 -1675.49 14.51 angle 90.0 town_number 0 

// Note: your missions have to use the variable defined here
0180: set_on_mission_flag_to $ONMISSION  
16@ = 0
// Run the Titles
//gosub @MAIN_TITLES
// START GAME
$DEFAULT_WAIT_TIME = 250
$ONMISSION = 0   


016A: fade 1 time 500
0001: wait 1000 ms 
Player.CanMove($PLAYER_CHAR) = True
Camera.Restore_WithJumpCut
Camera.SetBehindPlayer

01B7: release_weather
03E6: remove_text_box 
                                             
$CRASH_MARKER = Marker.CreateIconAndSphere(16, 2026.8145, 1109.2987, 10.813)

//Main Loop
:MAIN_LOOP
0001: wait $DEFAULT_WAIT_TIME ms
00BF: $TIME_HOURS = current_time_hours, $TIME_MINS = current_time_minutes



if and
$ONMISSION == 0
00E1:   player 0 pressed_key 11
jf @MAIN_LOOP

start_mission 0

0002: jump @MAIN_LOOP 


//This is "Path of the Snake" a very different mission where you get a chance to play all 3
//CRASH members.  The player will begin as Hernandez and depending on random chance could end
//up playing as all 3.  
:MISSN_08
thread 'MISSN_08' 
$ONMISSION = 1

gosub @MISSN_08_100                 //Begin Mission

if 
    wasted_or_busted            
then
    $CRASH_MARKER = Marker.CreateIconAndSphere(16, 2026.8145, 1109.2987, 10.813)
end

gosub @MISSN_08_CLEANUP             // End Mission Destroy All

end_thread 

:MISSN_08_100
054C: use_GXT_table 'JABM09'
Model.Load(#WMYBU)
038B: load_requested_models 
:MISSN_08_105
wait 0
if
Model.Available(#WMYBU)
jf @MISSN_08_105

//Dress CJ for cut scene
09C7: change_player $PLAYER_CHAR model_to #NULL 
Player.SetClothes($PLAYER_CHAR, "bbjersey", "sleevt", Torso)
Player.SetClothes($PLAYER_CHAR, "shortsgang", "shorts", Legs)
Player.SetClothes($PLAYER_CHAR, "convheatred", "conv", Shoes)
Player.SetClothes($PLAYER_CHAR, "goatee", "HEAD", Head)  
Player.Build($PLAYER_CHAR)
//Changes the player to ped model 290 Tenpenny
09C7: change_player $PLAYER_CHAR model_to 290 


009A: 1@ = create_actor_pedtype 4 model #WMYBU at 235.5933 76.7614 1005.0391
Actor.Angle(1@) = 184.0
0860: link_actor 1@ to_interior 6 


//Tenpenny walks into the PD
02A3: enable_widescreen 1 

05D3: AS_actor $PLAYER_ACTOR goto_point 1554.7235 -1674.9316 16.1953 mode 4 -1 ms 
:MISSN_08_wait1
wait 0
if 
00ED:   actor $PLAYER_ACTOR 0 near_point 246.784 63.9002 radius 1.0 1.0 on_foot
jf @MISSN_08_wait1
//Inside the building
05D3: AS_actor $PLAYER_ACTOR goto_point 245.8201 75.7424 1003.6406 mode 4 -1 ms 
0605: actor 1@ perform_animation_sequence "SEAT_IDLE" IFP_file "PED" 4.0 loop 1 0 0 0 time -1
:MISSN_08_wait2
wait 0
gosub @MISSN_08_skip_check
if 
100@ == 0
jf @MISSN_08_skip_cut
if 
00ED:   actor $PLAYER_ACTOR 0 near_point 245.8201 75.7424 radius 1.0 1.0 on_foot
jf @MISSN_08_wait2
05D3: AS_actor $PLAYER_ACTOR goto_point 236.7984 76.1412 1005.0391 mode 4 -1 ms 
:MISSN_08_wait3
wait 0
gosub @MISSN_08_skip_check
if 
100@ == 0
jf @MISSN_08_skip_cut
if 
00ED:   actor $PLAYER_ACTOR 0 near_point 236.7984 76.1412 radius 1.0 1.0 on_foot
jf @MISSN_08_wait3 
05BF: AS_actor 1@ look_at_actor $PLAYER_ACTOR -1 ms 
0605: actor 1@ perform_animation_sequence "SEAT_TALK_01" IFP_file "MISC" 4.0 loop 0 0 0 0 time 10000 
03CF: load_wav 44816 as 1 
// Frank we need to talk about the death of Officer Pendlebury.
gosub @MISSN_08_playwav
03CF: load_wav 45251 as 1 
gosub @MISSN_08_playwav
03CF: load_wav 44817 as 1 
gosub @MISSN_08_playwav
 // Did you know he was working with internal affairs?
0605: actor $PLAYER_ACTOR perform_animation_sequence "IDLE_TIRED" IFP_file "PED" 4.0 loop 1 0 0 0 time 5000 
03CF: load_wav 45252 as 1 
gosub @MISSN_08_playwav
0605: actor 1@ perform_animation_sequence "SEAT_WATCH" IFP_file "MISC" 4.0 loop 1 0 0 0 time -1 
03CF: load_wav 44818 as 1 
gosub @MISSN_08_playwav
//We have a federal witness that is going to be moved today.
05D3: AS_actor $PLAYER_ACTOR goto_point 247.0 75.7424 1003.6406 mode 4 -1 ms 
:MISSN_08_wait4
wait 0
gosub @MISSN_08_skip_check
if 
100@ == 0
jf @MISSN_08_skip_cut
if 
00ED:   actor $PLAYER_ACTOR 0 near_point 247.0 75.7424 radius 1.0 1.0 on_foot
jf @MISSN_08_wait4

05D3: AS_actor $PLAYER_ACTOR goto_point 246.0 62.3 1003.6406 mode 4 -1 ms 
jump @MISSN_08_wait5

:MISSN_08_skip_cut    //At the Exit
Actor.PutAt($PLAYER_ACTOR, 246.0, 62.3, 1003.6406)
Actor.DestroyInstantly(1@)
:MISSN_08_wait5
wait 0
if 
00ED:   actor $PLAYER_ACTOR 0 near_point 1552.45 -1674.99 radius 1.0 1.0 on_foot
jf @MISSN_08_wait5
wait 1000

01B4: set_player $PLAYER_CHAR can_move false 
00C0: set_current_time_hours_to 13 minutes_to 30 
0395: clear_area 1 at 1535.743 -1678.094 13.09914 radius 100.0 
//I lowered this to make finding another car more of a challenge
01EB: set_traffic_density_multiplier_to 0.5
03DE: set_pedestrians_density_multiplier_to 0.5 
fade 0 500
:MISSN_08_wait6
wait 0
if
not fading
jf @MISSN_08_wait6
//Setup
023C: load_special_actor 'PULASKI' as 2 
023C: load_special_actor 'HERN' as 3
Model.Load(#LAPD1)
Model.Load(#COPCARLA)
Model.Load(#DESERT_EAGLE)
Model.Load(#COLT45)
Model.Load(#PONY)
Model.Load(#PCJ600) 
Model.Load(#CHEETAH)
Model.Load(#YOSEMITE)
038B: load_requested_models 

:MISSN_08_110
wait 0
if and
    Model.Available(#LAPD1)          
    Model.Available(#COPCARLA)       
    Model.Available(#DESERT_EAGLE)   
    Model.Available(#COLT45)    
else_jump @MISSN_08_110     

:MISSN_08_120
wait 0
if and        
    Model.Available(#PONY)  
    Model.Available(#PCJ600) 
    Model.Available(#CHEETAH)
    Model.Available(#YOSEMITE)        
023D:   special_actor 2 loaded 
023D:   special_actor 3 loaded 
else_jump @MISSN_08_120 
//Three black pony vans
00A5: 11@ = create_car #PONY at 1477.906 -1735.2297 13.0046 
00A5: 12@ = create_car #PONY at 1487.906 -1735.2297 13.0046 
00A5: 13@ = create_car #PONY at 1497.906 -1735.2297 13.0046 
0229: set_car 11@ primary_color_to 0 secondary_color_to 0 
0229: set_car 12@ primary_color_to 0 secondary_color_to 0 
0229: set_car 13@ primary_color_to 0 secondary_color_to 0 
Car.Angle(11@) = 90.0
Car.Angle(12@) = 90.0
Car.Angle(13@) = 90.0
Car.SetImmunities(11@,1,1,1,1,1)
Car.SetImmunities(12@,1,1,1,1,1)
Car.SetImmunities(13@,1,1,1,1,1)
0190: add_car 11@ to_flipped_check 
0190: add_car 12@ to_flipped_check 
0190: add_car 13@ to_flipped_check  

//Three drivers for vans
0129: 14@ = create_actor_pedtype 6 model #LAPD1 in_car 11@ driverseat 
0129: 15@ = create_actor_pedtype 6 model #LAPD1 in_car 12@ driverseat 
0129: 16@ = create_actor_pedtype 6 model #LAPD1 in_car 13@ driverseat
039E: set_actor 14@ locked 1 while_in_car 
039E: set_actor 15@ locked 1 while_in_car 
039E: set_actor 16@ locked 1 while_in_car 

00A5: 17@ = create_car #PCJ600 at 1527.6476 -1713.7321 13.0321     //Hernandez
00A5: 18@ = create_car #CHEETAH at 1527.6476 -1703.7321 13.0321    //Pulaski
00A5: 19@ = create_car #YOSEMITE at 1527.6476 -1693.7321 13.0321   //Tenpenny
                        
Car.Angle(17@) = 180.0
Car.Angle(18@) = 180.0
Car.Angle(19@) = 180.0

70@ = Marker.CreateAboveCar(11@)

0129: 21@ = create_actor_pedtype 24 model #SPECIAL02 in_car 18@ driverseat 
0129: 22@ = create_actor_pedtype 24 model #SPECIAL01 in_car 19@ driverseat 
039E: set_actor 21@ locked 1 while_in_car 
039E: set_actor 22@ locked 1 while_in_car 
09F6: set_actor 21@ unjackable_through_driver_seat 1 
09F6: set_actor 22@ unjackable_through_driver_seat 1 
//Slip into Hernandez
072A: put_actor $PLAYER_ACTOR into_car 17@ driverseat 
09C7: change_player $PLAYER_CHAR model_to 292 

//Cut Scene
092F: lock_camera_target_point 1 
0930: lock_camera_position 1 
0920: point_camera 1500.0133 -1725.0502 13.5469  transverse_to 1487.906 -1735.2297 13.5469 time 24000 mode 1 
0936: set_camera 1508.917 -1713.3307 25.0  position_to 1471.0133 -1725.0502 13.5469  time 24000 drop_mode 1 
fade 1 2000

:MISSN_08_125
wait 0
if        
not fading
else_jump @MISSN_08_125 
0707: start_scene_skip_to @MISSN_08_CUT1
00BC: show_text_highpriority GXT 'POS01' time 8000 flag 1 
wait 8000
00BC: show_text_highpriority GXT 'POS02' time 8000 flag 1 
wait 8000
00BC: show_text_highpriority GXT 'POS03' time 8000 flag 1 
wait 8000
0920: point_camera 1527.6476 -1713.7321 13.0321 transverse_to 1527.6476 -1693.7321 13.0321 time 15000 mode 1 
0936: set_camera 1522.4 -1717.2471 16.5469  position_to 1522.4 -1706.278 16.5469  time 15000 drop_mode 1 
00BC: show_text_highpriority GXT 'POS04' time 8000 flag 1 
wait 8000
00BC: show_text_highpriority GXT 'POS05' time 10000 flag 1 
wait 10000
:MISSN_08_CUT1
0701: end_scene_skip 
//end cut scene
jump @MISSN_08_BEGIN

//Subroutine to handle skip scene
:MISSN_08_skip_check
100@ = 0
if or
00E1:   player 0 pressed_key 15 
00E1:   player 0 pressed_key 16 
00E1:   player 0 pressed_key 17 
then
100@ = 1
end
return


:MISSN_08_BEGIN
092F: lock_camera_target_point 0
0930: lock_camera_position 0 
015A: restore_camera 
02A3: enable_widescreen 0
00C0: set_current_time_hours_to 13 minutes_to 59
Camera.Restore_WithJumpCut
Camera.SetBehindPlayer        
01B4: set_player $PLAYER_CHAR can_move true 

//Pulaski and Tenpenny are told to keep up with their vans
//I was going to leave it up to the AI but it doesn't work well.
07F8: car 18@ follow_car 12@ radius 50.0 
07F8: car 19@ follow_car 13@ radius 50.0 

76@ = 0                                 //Loop Counter
77@ = 0                                 //Random Trip Timer
80@ = 0                                 //30 second timer
0@ = 0                                  //Van Index
32@ = 0                                 //Internal Timer
100@ = Actor.Car($PLAYER_ACTOR)         //Player Vehicle Flag
$7613 = 0                               //100 second clock Change Car
0209: 75@ = random_int_in_ranges 0 2    //REAL VAN
03C4: set_status_text $7613 type 1 GXT 'POS12'   
//First main loop to eliminate the decoys
:MISSN_08_200
wait 0
if
77@ <= 0      
then
gosub @MISSN_08_300   //Set vans to new destination
end
//Timers & Clocks
if
32@ >= 1000  //One second has passed
then
77@ -= 1     //Knock a second off the trip timer.
80@ -= 1     //Knock a second off the 30 second clock.
$7613 += 1   //Add to the ditch bar.
32@ = 0      //reset the internal timer.
end
//1st Van is the Real Van
if and
75@ == 0
76@ == 3
then
    0@ = 0
    jump @MISSN_08_240
end
//1st Decoy van eliminated
if and
75@ >= 1
76@ == 3
then 
gosub @MISSN_08_310
76@ = 4
end
//2nd Van is the Real Van
if and
75@ == 1 
76@ == 6
then     
    0@ = 1
    jump @MISSN_08_240
end
//2nd Decoy van eliminated
//3rd Van is the Real Van
if and
75@ == 2 
76@ == 6
then 
gosub @MISSN_08_320
jump @MISSN_08_240
end
//Ditch Car Timer at 50% Notice 
if 
$7613 == 50
then
00BC: show_text_highpriority GXT 'POS08' time 5000 flag 1 //Alert player with message
wait 1000  
end
//Ditch Timer Out Failed Mission
if 
$7613 < 100
jf @MISSN_08_400
//Player jumps out of car set 30 second count down
if and
80@ <= 0
not Actor.Driving($PLAYER_ACTOR)
then    
    $7613 = 70
    80@ = 30    
end
//Update 30 second count down
if and
80@ > 0
not Actor.Driving($PLAYER_ACTOR)
then
    01E5: show_text_1number_highpriority GXT 'POS09' number 80@ time 1000 flag 1  
end
//Player back in a car not his own
if 
Actor.Driving($PLAYER_ACTOR)
then
    99@ = Actor.Car($PLAYER_ACTOR)
end
if and
803B:   not  99@ == 100@ 
80@ >= 1
Actor.Driving($PLAYER_ACTOR)
then
    80@ = 0
    $7613 = 0
    100@ = Actor.Car($PLAYER_ACTOR)
end
//Loop the main if mission is possible
if or
Car.Wrecked(11@)
Car.Wrecked(12@)
Car.Wrecked(13@)
Actor.Dead($PLAYER_ACTOR)
jf @MISSN_08_200

jump @MISSN_08_400
//2nd Main Loop after Real Van is found.
:MISSN_08_240
00BC: show_text_highpriority GXT 'POS10' time 2000 flag 1   //Van is REAL 
0151: remove_status_text $7613                              //Remove the Ditch Timer
wait 2000
01EB: set_traffic_density_multiplier_to 0.3                 //Reduce Traffic

//Final Route to Mountian 
0615: define_AS_pack_begin 40@ 
05D1: AS_actor -1 drive_car -1 to 69.9967 -1264.9984 14.2374    speed -1 0 model #NULL 5 
05D1: AS_actor -1 drive_car -1 to -34.5788 -1347.3352 11.03     speed 40.0 3 model #NULL 5 
05D1: AS_actor -1 drive_car -1 to -295.5249 -1673.5956 14.9934  speed 40.0 3 model #NULL 5 
05D1: AS_actor -1 drive_car -1 to -360.8907 -2071.5735 27.9213  speed 40.0 3 model #NULL 5 
05D1: AS_actor -1 drive_car -1 to -32.6634 -2695.6592 42.1614   speed 40.0 3 model #NULL 5 
0616: define_AS_pack_end 40@ 
0618: assign_actor 14@(0@,3i) to_AS_pack 40@ 
061B: remove_references_to_AS_pack 40@

0615: define_AS_pack_begin 41@ 
05D1: AS_actor -1 drive_car -1 to -314.753 -2799.2463 57.5592   speed 40.0 3 model #NULL 5 
05D1: AS_actor -1 drive_car -1 to -958.7205 -2856.0054 67.8951  speed 40.0 3 model #NULL 5
05D1: AS_actor -1 drive_car -1 to -1200.0046 -2857.2893 68.1651 speed 30.0 3 model #NULL 5
05D1: AS_actor -1 drive_car -1 to -1834.4307 -2528.8721 51.405  speed 20.0 3 model #NULL 5 
05D1: AS_actor -1 drive_car -1 to -2323.5935 -2202.658 32.2548  speed -1 0 model #NULL 5 
0616: define_AS_pack_end 41@ 

:MISSN_08_250
wait 0
//Change packs
if
00EC:   actor 14@(0@,3i) 0 near_point -32.6634 -2695.6592 radius 10.0 10.0
then
0618: assign_actor 14@(0@,3i) to_AS_pack 41@ 
061B: remove_references_to_AS_pack 41@ 
end

if
00EC:   actor $PLAYER_ACTOR 1 near_point -2210.7866 -2267.5562 radius 10.0 10.0
then
    jump @MISSN_08_500   //Mission Completed
end

//1st Warning at 75 meters
if and
100@ = 0
80F2:   not actor $PLAYER_ACTOR near_actor 14@(0@,3i) radius 75.0 75.0 0 
then
00BC: show_text_highpriority GXT 'POS07' time 2000 flag 1   //Van is getting away! 
100@ == 1
end 
//2nd Warning at 100 meters
if and
100@ = 1
80F2:   not actor $PLAYER_ACTOR near_actor 14@(0@,3i) radius 100.0 100.0 0 
then
00BC: show_text_highpriority GXT 'POS07' time 2000 flag 1   //Van is getting away! 
03E7: flash_hud_component 8
wait 500
03E7: flash_hud_component -1 
100@ == 2
end
//Reset warning flag
if and
100@ > 0
00F2:   actor $PLAYER_ACTOR near_actor 14@(0@,3i) radius 70.0 70.0 0 
then
100@ == 0
end
if or
80F2:   not actor $PLAYER_ACTOR near_actor 14@(0@,3i) radius 150.1 150.1 0 
Actor.Dead($PLAYER_ACTOR)
Actor.Dead(14@(0@,3i))
Car.Wrecked(11@(0@,3i))
jf @MISSN_08_250

jump @MISSN_08_400

:MISSN_08_300
0209: 1@ = random_int_in_ranges 0 8
//8 false routes 0 to 7
//Example of nesting IF THEN ELSE END; when you compile this code then decompile it,
//you will see there are no THEN ELSE END statements just JUMP_FALSE and JUMP.
if
1@ == 0
then
05D1: AS_actor 14@(0@,3i) drive_car 11@(0@,3i) to 2295.2314 81.4567 26.3835 speed -1 0 model #NULL 1 
else
if
1@ == 1
then
05D1: AS_actor 14@(0@,3i) drive_car 11@(0@,3i) to 1337.0192 308.3812 19.4558 speed -1 0 model #NULL 1 
else
if
1@ == 2
then
05D1: AS_actor 14@(0@,3i) drive_car 11@(0@,3i) to 228.9058 -134.1119 1.4924 speed -1 0 model #NULL 1 
else
if
1@ == 3
then
05D1: AS_actor 14@(0@,3i) drive_car 11@(0@,3i) to 679.9637 -559.8632 16.2499 speed -1 0 model #NULL 1 
else
if
1@ == 4
then
05D1: AS_actor 14@(0@,3i) drive_car 11@(0@,3i) to 794.0325 -1134.7882 23.845 speed -1 0 model #NULL 1 
else
if
1@ == 5
then
05D1: AS_actor 14@(0@,3i) drive_car 11@(0@,3i) to 323.2133 -1628.9924 33.2131 speed -1 0 model #NULL 1 
else
if
1@ == 6
then
05D1: AS_actor 14@(0@,3i) drive_car 11@(0@,3i) to -467.3326 -2177.4775 59.6863 speed -1 0 model #NULL 1 
else
if
1@ == 7
then
05D1: AS_actor 14@(0@,3i) drive_car 11@(0@,3i) to -1532.7924 -1604.7435 37.8908 speed -1 0 model #NULL 1 
end // 7
end // 6
end // 5
end // 4
end // 3
end // 2
end // 1
end // 0
    
0@ += 1
if
0@ == 3
then
0@ = 0
0209: 77@ = random_int_in_ranges 120 240  //Trip timer in seconds 2 to 4 minutes 
76@ += 1
end
return 

:MISSN_08_310
00BC: show_text_highpriority GXT 'POS06' time 2000 flag 1   //Van is a decoy. 
wait 2000
fade 0 0
:MISSN_08_315
wait 0
if 
not fading
jf @MISSN_08_315
//Get the van postion and put the chase car behind it.
if 
80F2:   not actor 21@ near_actor 15@ radius 150.1 150.1 0 
then
00AA: store_car 12@ position_to 3@ 4@ 5@ 
6@ = Car.Angle(12@)
02F6: $TEMPVAR_FLOAT_1 = cosine 6@ 
02F7: $TEMPVAR_FLOAT_2 = sine 6@ 
$TEMPVAR_FLOAT_1 *= 5.0
$TEMPVAR_FLOAT_1 *= 5.0
0059: 3@ += $TEMPVAR_FLOAT_1 
0059: 4@ -= $TEMPVAR_FLOAT_2 
Car.PutAt(18@, 3@, 4@, 5@)
Car.Angle(18@) = 6@
end
0792: disembark_instantly_actor $PLAYER_ACTOR 
0792: disembark_instantly_actor 21@
009B: destroy_actor 21@
072A: put_actor $PLAYER_ACTOR into_car 18@ driverseat 
09C7: change_player $PLAYER_CHAR model_to 291 
Marker.Disable(70@)
70@ = Marker.CreateAboveCar(12@)
Camera.Restore_WithJumpCut
Camera.SetBehindPlayer
fade 1 0
:MISSN_08_316
wait 0
if 
not fading
jf @MISSN_08_316

return

:MISSN_08_320
00BC: show_text_highpriority GXT 'POS06' time 2000 flag 1   //Van is a decoy. 
wait 2000
fade 0 0
:MISSN_08_325
wait 0
if 
not fading
jf @MISSN_08_325
//Get the van postion and put the chase car behind it.
if 
80F2:   not actor 22@ near_actor 16@ radius 150.1 150.1 0 
then
00AA: store_car 13@ position_to 3@ 4@ 5@ 
6@ = Car.Angle(13@)
02F6: $TEMPVAR_FLOAT_1 = cosine 6@ 
02F7: $TEMPVAR_FLOAT_2 = sine 6@ 
$TEMPVAR_FLOAT_1 *= 5.0
$TEMPVAR_FLOAT_1 *= 5.0
0059: 3@ += $TEMPVAR_FLOAT_1 
0059: 4@ -= $TEMPVAR_FLOAT_2 
Car.PutAt(19@, 3@, 4@, 5@)
Car.Angle(19@) = 6@
end
0792: disembark_instantly_actor $PLAYER_ACTOR 
0792: disembark_instantly_actor 22@
009B: destroy_actor 22@
072A: put_actor $PLAYER_ACTOR into_car 19@ driverseat 
09C7: change_player $PLAYER_CHAR model_to 290 
Marker.Disable(70@)
70@ = Marker.CreateAboveCar(13@)
Camera.Restore_WithJumpCut
Camera.SetBehindPlayer
fade 1 0
:MISSN_08_326
wait 0
if 
not fading
jf @MISSN_08_326
77@ = 999
0@ = 2
return

:MISSN_08_400
0151: remove_status_text $7613         
00BA: show_text_styled GXT 'M_FAIL' time 5000 style 1  // ~r~MISSION FAILED!
$ONMISSION = 0 
wait 4000
fade 0 1000
:MISSN_08_410
wait 0
if 
not fading 
jf @MISSN_08_410
0164: disable_marker 70@ 
if
Actor.Driving($PLAYER_ACTOR)
then
0362: remove_actor $PLAYER_ACTOR from_car_and_place_at 1550.68 -1675.49 14.51
else
00A1: put_actor $PLAYER_ACTOR at 1550.68 -1675.49 14.51 
end
03CB: set_rendering_origin_at 1550.68 -1675.49 14.51  
09C7: change_player $PLAYER_CHAR model_to 290 
fade 1 2000
:MISSN_08_420
wait 0
if 
not fading 
jf @MISSN_08_420
Camera.Restore_WithJumpCut
Camera.SetBehindPlayer
return

:MISSN_08_playwav
wait 0
if 
03D0:   wav 1 loaded 
jf @MISSN_08_playwav
03D1: play_wav 1 
:MISSN_08_playwav2
wait 0
if 
03D2:   wav 1 ended 
jf @MISSN_08_playwav2
040D: unload_wav 1 
return

//Mission Complete
:MISSN_08_500
00BC: show_text_highpriority GXT 'POS11' time 5000 flag 1   
wait 6000

02E4: load_cutscene_data 'BCRAS1' 
Camera.SetAtPos(-2011.438, -2501.287, 34.0624)
0395: clear_area 1 at -2011.438 -2501.287 34.0624 radius 100.0 
03E6: remove_text_box 
054C: use_GXT_table 'BCRASH1' 

:MISSN_08_510
wait 0
if 
06B9:   cutscene_data_loaded 
jf @MISSN_08_510

wait 1000 
02E7: start_cutscene 
fade 1 1000 

:MISSN_08_520
wait 0 
if 
02E9:   cutscene_reached_end 
jf @MISSN_08_520 

fade 0 0 

:MISSN_08_530
wait 0 
if 
not fading 
jf @MISSN_08_530 

02EA: end_cutscene 
02E4: load_cutscene_data 'BCRAS2' 

:MISSN_08_540
wait 0 
if 
06B9:   cutscene_data_loaded 
jf @MISSN_08_540 

02E7: start_cutscene 
fade 1 1000 

:MISSN_08_550
wait 0 
if 
02E9:   cutscene_reached_end 
jf @MISSN_08_550 

fade 0 0 

:MISSN_08_560
wait 0
if 
not fading 
jf @MISSN_08_560

02EA: end_cutscene 

09C7: change_player $PLAYER_CHAR model_to 290 
Camera.Restore_WithJumpCut
Camera.SetBehindPlayer        
fade 1 1000 
:MISSN_08_570
wait 0
if 
not fading 
jf @MISSN_08_570
0164: disable_marker 70@ 
030C: progress_made += 1 
0394: play_music 1 
Player.ClearWantedLevel($PLAYER_CHAR)
01E3: show_text_1number_styled GXT 'M_PASSR' number 7 time 5000 style 1  // MISSION PASSED!~n~~w~RESPECT +
0998: add_respect 1 
return

:MISSN_08_CLEANUP

$ONMISSION = 0 

mission_cleanup 
return
